#include <stdio.h>
#include <string.h>
#include <stdlib.h>

struct ac
{
	int i;
	char data[0];
};

int main(int argc, char* argv[])
{
	void * p = NULL;
	char buf[10] = "abcdefghi";	
	struct ac * info = (struct ac *)malloc(sizeof(struct ac) + 10);

	info->i = 9;
	p = (void*)info->data;

	printf("%d\n", sizeof(struct ac));		// 4
	printf("info address:%p\n", info, p);	// 0x56542a4742a0   ---> ac结构体的首指针
	printf("   p address:%p\n", p);			// 0x56542a4742a4   ---> p指向的地址，ac结构体的第二个变量的地址+4
	printf("   p address:%p\n", &p);		// p 自身的地址

	strncpy((char*)p, buf, info->i);
	printf("%s\n", (char*)p);				// abcdefghi

	return 0;
}
